<template>
  <div class="dashboard-container">
    <div class="dashboard-box">
      <div class="dashboard-text">用户名称:{{ nickname }}</div>
      <div class="dashboard-text">用户角色:<span v-for="role in roles" :key="role">{{ role===[]?'-':role }}</span></div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'nickname',
      'roles'
    ])
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard-container {
    position: fixed;
    top: 50px;
    left: 0;
    height:100%;
    width:100%;
    background: rgba(0, 0, 0, 0.5);
  }
  .dashboard-box {
    position: absolute;
    top: 200px;
    left: 50%;
    transform: translate(-50%, -50%);
    .dashboard-text {
      font-size: 30px;
      line-height: 46px;
      color: white;
    }
  }

</style>
